package net.lwf.hibernate.entity.worksheet;

import net.lwf.common.constant.ICommonConstant;

public class WorkSheetInfo {
	
	private long id;
	private String grade;
	private String subject;
	private String topic;
	private String type;
	private String typeDescription;
	private String fileName;
	private String filePath;
	private long displayAllInAType;
	private long printRestrictions;
	private String implementation;
	private String problemText;
	private String solution;
	private String status;
	
	private String encryptedPrintKey;

	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getGrade() {
		return grade;
	}
	public void setGrade(String grade) {
		this.grade = grade;
	}
	public String getSubject() {
		return subject;
	}
	public void setSubject(String subject) {
		this.subject = subject;
	}
	public String getTopic() {
		return topic;
	}
	public void setTopic(String topic) {
		this.topic = topic;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getFilePath() {
		return filePath;
	}
	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getTypeDescription() {
		return typeDescription;
	}
	public void setTypeDescription(String typeDescription) {
		this.typeDescription = typeDescription;
	}
	
	public long getDisplayAllInAType() {
		return displayAllInAType;
	}
	public void setDisplayAllInAType(long displayAllInAType) {
		this.displayAllInAType = displayAllInAType;
	}
	public long getPrintRestrictions() {
		return printRestrictions;
	}
	public void setPrintRestrictions(long printRestrictions) {
		this.printRestrictions = printRestrictions;
	}
	public String getImplementation() {
		return implementation;
	}
	public void setImplementation(String implementation) {
		this.implementation = implementation;
	}
	public String getProblemText() {
		return problemText;
	}
	public void setProblemText(String problemText) {
		this.problemText = problemText;
	}
	public String getSolution() {
		return solution;
	}
	public void setSolution(String solution) {
		this.solution = solution;
	}
	public boolean hasPrintRestrictions() {
		if(this.printRestrictions == 1) {
			return true;
		}
		return false;
	}
	
	public String getPrintKey() {
		String key = this.id + ICommonConstant.PIPE +
					 this.filePath + ICommonConstant.FORWARD_SLASH +
					 this.fileName;
		return key;
	}

	public void encryptPrintKey(String printKey) {
		this.encryptedPrintKey = printKey;
	}

	public String getEncryptedPrintKey() {
		return encryptedPrintKey;
	}
	public void print() {
		System.out.println("==> Key: " + this.id + ", Display Restriction: " + hasPrintRestrictions() + ", Grade: " + this.grade + ", Suject: " + this.subject + ", Topic: " + this.topic + ", Type: " + this.type + ", Type Description: " + this.typeDescription + ", File Name:" + this.fileName + ", File Path: " + this.filePath + ", Status: " + this.status);
	}

}
